1. Field of the Invention
The present invention relates to technology for initializing a printer having a DMA transfer mode.
2. Description of the Related Art
Some printers have a DMA transfer mode that is used to transfer image data contained in an image print command from the receive buffer to the print buffer by direct memory access (DMA) when an image print command is received. In the DMA transfer mode, DMA transfer of the received data continues until data equal to the size of the image data contained in the image print command has been transferred.
As a result, if the printer is connected to a host device by a USB cable, for example, and the cable is disconnected while the host device is sending the image print command, the printer remains in the DMA transfer mode waiting for the unsent data. If the host device and printer are then reconnected, the printer must be reinitialized. For the printer to be reinitialized, however, data equal to or greater than the size of the unsent image data in the image print command that was being sent when the connection was interrupted must be sent again in order to terminate the DMA transfer mode.
A conventional printer of this type therefore sends null data of a predetermined fixed size before sending the printer initialization command.
A problem with this arrangement is that the null data that is sent before the initialization command is a fixed size regardless of the data size of the image print command, and may therefore contain too much or too little data. If a large block of null data is sent even though only a small amount of data is needed, for example, time is wasted sending unnecessary data. On the other hand, if a large amount of data is required but the fixed size of the null data is too small, cancelling the DMA transfer mode may not be possible.